import request from '@/utils/request'

export function getglobalSettings() {
  return request({
    url: '/globalSettings',
    method: 'get'
  })
}

export function getModelList() {
  return request({
    url: '/globalSettings/modelList',
    method: 'get'
  })
}

export function searchGlobalSettings(data) {
  return request({
    url: '/globalSettings',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}

export function addGlobalSetting(data) {
  return request({
    url: '/globalSettings/add',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}

export function deleteGlobalSetting(name) {
  return request({
    url: `/globalSettings/${name}`,
    method: 'delete'
  })
}

export function updateGlobalSetting(data) {
  return request({
    url: '/globalSettings',
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}

export function updateAllGlobalSetting(data) {
  return request({
    url: '/globalSettings/update',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: data
  })
}
